#include <iostream>
using namespace std;

class B
{
    protected:
        int x;
        int y;
    public:
        B():x(0),y(0)
        { cout << __PRETTY_FUNCTION__ << " " << endl; }

        // 构造函数重载
        // C++11新特性，委托构造函数
        B(int i) : B(i, 0){}

        B(int i, int j) : x(i), y(j)
        { cout << __PRETTY_FUNCTION__ << endl; }
};

class D : public B
{
    public:
        D() { cout << __PRETTY_FUNCTION__ << endl; }

        D(int i): B(i) { cout << __PRETTY_FUNCTION__ << endl; }
};


int main(){
    B b1;       cout << endl;
    B b2(1);    cout << endl;
    B b3(1, 2); cout << endl;
    D d1;       cout << endl;
    D d2(1); 
    return 0;
}
